package model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


@NoArgsConstructor
@AllArgsConstructor
@Data
public class Course implements java.io.Serializable {
	private String courseId;
	private String courseName;
	private MyCourseTime courseTime;
	private String courseTeacher;
	private String courseLocation;
	private int courseCapacity;
	private int courseRemainingCapacity;
	private Boolean courseChooseStation;//为true,表示被选过。否则表示还没有选
	private Boolean courseTimeConflict=false;//为true，表示存在时间冲突。

	/*
	退课操作。将课程余量加一
	 */
	public boolean dropOutCourse() {
		courseRemainingCapacity++;
		return true;
	}

	public boolean getChoosen()
	{
		return courseChooseStation;
	}
	public Course(String courseId, String courseName, MyCourseTime courseTime,
                  String courseTeacher, String courseLocation, int courseCapacity) {
		super();
		this.courseId = courseId;
		this.courseName = courseName;
		this.courseTime = courseTime;
		this.courseTeacher = courseTeacher;
		this.courseLocation=courseLocation;
		this.courseCapacity = courseCapacity;
		this.courseRemainingCapacity=courseCapacity;
	}
	
	public Course(String courseId, String courseName, int cW, int cB, int cE,
                  String courseTeacher, String courseLocation, int courseCapacity) {
		super();
		this.courseId = courseId;
		this.courseName = courseName;
		MyCourseTime mCT=new MyCourseTime(cW,cB,cE);
		this.courseTime = mCT;
		this.courseTeacher = courseTeacher;
		this.courseLocation=courseLocation;
		this.courseCapacity = courseCapacity;
		this.courseRemainingCapacity=courseCapacity;
	}
	public Course(String courseId, String courseName, int cW, int cB, int cE,
                  String courseTeacher, String courseLocation, int courseCapacity, int courseRemainingCapacity) {
		super();
		this.courseId = courseId;
		this.courseName = courseName;
		MyCourseTime mCT=new MyCourseTime(cW,cB,cE);
		this.courseTime = mCT;
		this.courseTeacher = courseTeacher;
		this.courseLocation=courseLocation;
		this.courseCapacity = courseCapacity;
		this.courseRemainingCapacity=courseRemainingCapacity;
	}
	
	public Course(String courseId, String courseName, String cW, int cB, int cE,
                  String courseTeacher, String courseLocation, int courseCapacity) {
		super();
		this.courseId = courseId;
		this.courseName = courseName;
		MyCourseTime mCT=new MyCourseTime(cW,cB,cE);
		this.courseTime = mCT;
		this.courseTeacher = courseTeacher;
		this.courseLocation=courseLocation;
		this.courseCapacity = courseCapacity;
		this.courseRemainingCapacity=courseCapacity;
	}

	public String getCourseId() {
		return courseId;
	}

	public void setCourseId(String courseId) {
		this.courseId = courseId;
	}

	public String getCourseName() {
		return courseName;
	}

	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}

	public MyCourseTime getCourseTime() {
		return courseTime;
	}

	public void setCourseTime(int cW,int cB,int cE) {
		MyCourseTime mCT=new MyCourseTime(cW,cB,cE);
		this.courseTime = mCT;
	}
	public void setCourseTime(String cW,int cB,int cE) {
		MyCourseTime mCT=new MyCourseTime(cW,cB,cE);
		this.courseTime = mCT;
	}

	public String getCourseTeacher() {
		return courseTeacher;
	}

	public void setCourseTeacher(String courseTeacher) {
		this.courseTeacher = courseTeacher;
	}
	
	public String getCourseLocation() {
		return courseLocation;
	}

	public void setCourseLocation(String courseLocation) {
		this.courseLocation = courseLocation;
	}

	public int getCapacity() {
		return courseCapacity;
	}

	public void setCapacity(int capacity) {
		this.courseCapacity = capacity;
	}

	public void selectCourse() {
		this.courseRemainingCapacity--;
	}

	public int getCourseTime_Week() {
		// TODO 自动生成的方法存根
		return this.courseTime.classWeek;
	}

	public int getCourseTime_Begin() {
		// TODO 自动生成的方法存根
		return this.courseTime.classBegin;
	}

	public int getCourseTime_End() {
		// TODO 自动生成的方法存根
		return this.courseTime.classEnd;
	}

}


